﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Structure.Objects
{
    public enum eRole {eROLE_MANAGER = 1, eROLE_COMMITER, eROLE_OBSERVER};

    public class User
    {
        //Переменная Cur_User - пользователь приложения
        public static User Cur_User;

        protected eRole m_Role;
        private string m_Credentials;
        private string m_Login;
        private string m_Password;
        
        public string Login
        {
            get { return m_Login; }
        }

        public string Password
        {
            get { return m_Password; }
        }

        public string Credentials
        {
            get { return m_Credentials; }
        }

        public eRole Role
        {
            get { return m_Role; } 
        }


        public User(string pLogin, string pPass, string pCredentials) 
        { 
            m_Login = pLogin;
            m_Credentials = pCredentials;
            m_Password = pPass;
        }

    }

    public class Manager : User
    {
        public Manager (string pLogin, string pPass, string pCredentials)
            : base(pLogin, pPass, pCredentials)
        {
            m_Role = eRole.eROLE_MANAGER;
        }
    }

    public class Commiter : User
    {
        public Commiter(string pLogin, string pPass, string pCredentials)
            : base(pLogin, pPass, pCredentials)
        {
            m_Role = eRole.eROLE_COMMITER;
        }
    }

    public class Observer : User
    {
        public Observer(string pLogin, string pPass, string pCredentials)
            : base(pLogin, pPass, pCredentials)
        {
            m_Role = eRole.eROLE_OBSERVER;
        }
    }
}
